/*
 * 2009-04-19 Florin Muntean: Update to the About Dialog to reflect the project new location.
 * 
 * 
 * 
 * 
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;

namespace SPTraceView
{
    public partial class frmAbout : Form
    {
        private const string PROJECT_HOME_URL = "http://sptraceview.codeplex.com";
        private const string PROJECT_TEAM_URL = "http://sptraceview.codeplex.com/People/ProjectPeople.aspx";
        private const string PROJECT_LICENSE_URL = "http://sptraceview.codeplex.com/license";
        private const string PROJECT_ISSUES_URL = "http://sptraceview.codeplex.com/WorkItem/List.aspx";

        public frmAbout(Icon icon)
        {
            InitializeComponent();

            this.Icon = icon;

            object[] fileAttr = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
            if (fileAttr != null &&
                fileAttr.Length == 1)
            {
                AssemblyFileVersionAttribute fileVer = (AssemblyFileVersionAttribute)fileAttr[0];
                lblVersion.Text = fileVer.Version;
            }
            else
                lblVersion.Text = "N/A";

        }

        

        private void linkLabelProject_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(PROJECT_HOME_URL);
        }

        private void linkLabelTeam_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(PROJECT_TEAM_URL);
        }

        private void linkLabelLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(PROJECT_LICENSE_URL);
        }

        private void frmAbout_Load(object sender, EventArgs e)
        {
            this.labelCopyright.Text = string.Format("{0} - {1}", this.labelCopyright.Text, DateTime.Today.Year);
        }

        private void linkLabelBugs_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(PROJECT_ISSUES_URL);
        }
    }
}